function [atkf,atkm,tauA] = autarky(H, wf, wm, t, det_earn_f, det_earn_m, gamma,dt)

tauA=(gamma*w(det_earn_m,t,H-1,wm,dt)-w(det_earn_f,t-(H-1),0,wf,dt))/(1+gamma);

W=w(det_earn_m,t,H-1,wm,dt)+w(det_earn_f,t-(H-1),0,wf,dt);

if tauA>0
atkf=log(0.61*((W/2)*(gamma/(1+gamma)))^2); 
atkm=log(0.61*(W/(1+gamma))*((W/2)*(gamma/(1+gamma)))^gamma); 
else
    atkf=log(0.61*(w(det_earn_f,t-(H-1),0,wf,dt)/2)^2);
    atkm=log(0.61*w(det_earn_m,t,H-1,wm,dt)*(w(det_earn_f,t-(H-1),0,wf,dt)/2)^gamma);
end
end
